package com.ruoyi.salesInvoice.service;

import com.ruoyi.salesInvoice.domain.SalesInvoiceModel;
import com.ruoyi.salesInvoice.domain.SalesInvoiceOrder;

import java.util.List;
import java.util.Map;

public interface SalesInvoiceService {
    /**
     * 查询销售发票订单列表
     *
     * @param salesInvoiceOrder 查询条件
     * @return 结果
     */
    List<SalesInvoiceOrder> selectSalesInvoice(SalesInvoiceOrder salesInvoiceOrder);




    /**
     * 插入销售发票信息
     *
     * @param salesInvoiceOrder 插入数据
     * @return 结果
     */
    int insertSalesInvoiceOrder(SalesInvoiceOrder salesInvoiceOrder);

    /**
     * 查询销售发票信息
     *
     * @param salesInvoiceId 查询条件
     * @return 结果
     */
    SalesInvoiceOrder selectSalesInvoiceOrderById(Long salesInvoiceId);

    /**
     * 修改销售发票信息
     *
     * @param salesInvoiceOrder 修改数据
     * @return 结果
     */
    int updateSalesInvoiceOrder(SalesInvoiceOrder salesInvoiceOrder);

    /**
     * 删除销售发票信息
     *
     * @param salesInvoiceId 销售发票id
     * @return 结果
     */
    int deleteSalesInvoiceOrderById(Long salesInvoiceId);

    /**
     * 计算销售发票数据
     *
     * @param salesInvoiceId 销售发票主键
     * @return 结果
     */
    int countSalesGoods(Long salesInvoiceId);

    /**
     * 计算销售发票数据
     *
     * @param salesInvoiceId 销售发票主键
     * @return 结果
     */
    int countReturnSalesGoods(Long salesInvoiceId);

    /**
     * 查询销售发票子表数据信息
     *
     * @param salesInvoiceNo 销售发票子表
     * @return 结果
     */
    SalesInvoiceModel selectSalesInvoiceModelById(Long salesInvoiceNo);

    SalesInvoiceModel selectInvoiceByIds(SalesInvoiceModel salesInvoiceModel);

    List<SalesInvoiceModel> selectSalesInvoiceModelByOrderId(Long salesInvoiceId);

    /**
     * 计算销售发票中销货单是否全部生成销售发票
     *
     * @param salesInvoiceId 销售发票主键
     * @return 结果
     */
    int countIsInvoice(Long salesInvoiceId);

    /**
     * 审核状态流转
     * @param salesInvoiceOrder
     * @return
     */
    int auditSale(SalesInvoiceOrder salesInvoiceOrder);

    // 获取上一条记录
    Long querypreviousId(Long salesInvoiceId);

    // 获取下一条记录
    Long queryNextId(Long salesInvoiceId);

    List<Map<String, Object>> pendingReview(Long deptID);
}
